package org.stu.tp.dao;

import java.util.List;

import org.hibernate.Session;
import org.stu.tp.dto.*;
import org.stu.tp.util.HibernateUtil;

public class ContactDao {
	@SuppressWarnings("unchecked")
	public static Contact getContact(String recordName){
		Contact contact=new Contact();
		Session session = HibernateUtil.currentSession();
		List <Contact> userList=session.createSQLQuery("select * from contact where RecordName="+"'"+recordName+"'").addEntity(Contact.class).list();
		contact=userList.get(0);
		HibernateUtil.closeSession();
		return contact;
	}
	
}

